<template>
	<el-container>
		<el-header style="height: auto;">
			<div class="left-panel"></div>
			<div class="right-panel">
				<div class="right-panel-search">
					<el-input v-model="search.keyword" placeholder="用户名" style="width: 150px"></el-input>
					<el-date-picker v-model="search.start_time" type="date" placeholder="开始日期" format="YYYY-MM-DD"
									value-format="YYYY-MM-DD" style="width: 150px"/>
					<el-date-picker v-model="search.end_time" type="date" placeholder="结束日期" format="YYYY-MM-DD"
									value-format="YYYY-MM-DD" style="width: 150px"/>
					<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
					<el-button type="info" @click="resetUpsearch">重置</el-button>
				</div>
			</div>
		</el-header>
		<el-main class="nopadding">
			<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe>
				<el-table-column type="selection" min-width="50"></el-table-column>
				<el-table-column label="ID" prop="id" min-width="150"></el-table-column>
				<el-table-column label="登录时间" prop="login_at" min-width="180"></el-table-column>
				<el-table-column label="来源" prop="source_name" min-width="100"></el-table-column>
				<el-table-column label="用户名" prop="username" min-width="150"></el-table-column>
				<el-table-column label="设备" prop="device" min-width="480"></el-table-column>
				<el-table-column label="APP版本" prop="app_version" min-width="150"></el-table-column>
				<el-table-column label="IP地址" prop="login_ip" min-width="150"></el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script>

export default {
	name: 'log',
	components: {},
	data() {
		return {
			groupId: "0",
			apiObj: this.$API['admin.log'].loginIndex,
			search: {
				keyword: "",
			}
		}
	},
	methods: {
		//搜索
		upsearch() {
			this.$refs.table.reload(this.search)
		},

		//搜索重置
		resetUpsearch() {
			this.search = {};
			this.$refs.table.reload(this.search)
		},
	}
}
</script>

<style></style>
